#ifndef ICNT_WRAPPER_H
#define ICNT_WRAPPER_H

#include <stdio.h>
#include <cstdint>

// functional interface to the interconnect

typedef void (*icnt_create_p)(uint32_t n_shader, uint32_t n_mem);
typedef void (*icnt_init_p)();
typedef bool (*icnt_has_buffer_p)(uint32_t input, uint32_t size);
typedef void (*icnt_push_p)(uint32_t input, uint32_t output, void *data,
                            uint32_t size);
typedef void *(*icnt_pop_p)(uint32_t output);
typedef void (*icnt_transfer_p)();
typedef bool (*icnt_busy_p)();
typedef void (*icnt_drain_p)();
typedef void (*icnt_display_stats_p)();
typedef void (*icnt_display_overall_stats_p)();
typedef void (*icnt_display_state_p)(FILE *fp);
typedef uint32_t (*icnt_get_flit_size_p)();

extern icnt_create_p icnt_create;
extern icnt_init_p icnt_init;
extern icnt_has_buffer_p icnt_has_buffer;
extern icnt_push_p icnt_push;
extern icnt_pop_p icnt_pop;
extern icnt_transfer_p icnt_transfer;
extern icnt_busy_p icnt_busy;
extern icnt_drain_p icnt_drain;
extern icnt_display_stats_p icnt_display_stats;
extern icnt_display_overall_stats_p icnt_display_overall_stats;
extern icnt_display_state_p icnt_display_state;
extern icnt_get_flit_size_p icnt_get_flit_size;
extern uint32_t g_network_mode;

enum network_mode
{
    INTERSIM = 1,
    LOCAL_XBAR = 2,
    N_NETWORK_MODE
};

void icnt_wrapper_init();
void icnt_reg_options(class OptionParser *opp);

#endif
